<template>
  <view :style="colorStyle">
    <!-- 优惠券弹窗 -->
    <view class="coupon-window" :class="window == true ? 'on' : ''">
      <view class="couponWinList">
        <view class="item acea-row row-between-wrapper">
          <image :src="couponImage" mode="widthFix"></image>
        </view>
      </view>
      <view class="lid">
        <view class="bnt" @click="shareContent">邀请注册</view>
        <view class="iconfont icon-guanbi3" @click="close"></view>
      </view>
    </view>
    <view class="mask" catchtouchmove="true" :hidden="window == false"></view>
  </view>
</template>

<script>
import colors from '@/mixins/color'
import { HTTP_REQUEST_URL } from '@/config/app'
export default {
  props: {
    window: {
      type: Boolean | String | Number,
      default: false
    },
    couponList: {
      type: Array,
      default: function () {
        return []
      }
    },
    couponImage: {
      type: String,
      default: ''
    },
    user: {
      type: Object,
      default: function () {
        return {}
      }
    }
  },
  mixins: [colors],
  data() {
    return {
      imgHost: HTTP_REQUEST_URL
    }
  },
  methods: {
    close: function () {
      this.$emit('onColse')
    }
    // shareContent: function () {
    //   this.$emit('setShareInfo')
    //   // , { link: `https://mp.tianxuan88.com/pages/users/login/register?spid=${this.user.uid}`, imgUrl: this.couponImage }
    // }
  }
}
</script>

<style scoped lang="scss">
.mask {
  z-index: 9999;
}

.coupon-window {
  width: 550rpx;
  height: 750rpx;
  position: fixed;
  top: 20%;
  z-index: 10000;
  left: 50%;
  margin-left: -275rpx;
  transform: translate3d(0, -200%, 0);
  transition: all 0.3s cubic-bezier(0.25, 0.5, 0.5, 0.9);
  overflow-x: hidden;
  border-radius: 20rpx;
  padding: 20rpx;
}

.coupon-window:after {
  width: 550rpx;
  height: 750rpx;
  position: absolute;
  top: 0%;
  left: 50%;
  z-index: 11111;
  margin-left: -275rpx;
  content: '';
  background: rgba(255, 255, 255, 0.5);
}

.coupon-window.on {
  transform: translate3d(0, 0, 0);
}

.coupon-window .couponWinList {
  width: 510rpx;
  overflow: auto;
}

.coupon-window .couponWinList .item {
  width: 100%;
  background-color: #fff;
  position: relative;
  margin-bottom: 17rpx;
  position: relative;
  z-index: 99999;
}

.coupon-window .couponWinList .item .left {
  border-right: 1px dashed #ccc;
}

.coupon-window .couponWinList .label {
  width: 28rpx;
  height: 64rpx;
  display: block;
  position: absolute;
  top: 0;
  right: 12rpx;
}

.coupon-window .couponWinList .item::after {
  content: '';
  position: absolute;
  width: 18rpx;
  height: 18rpx;
  border-radius: 50%;
  left: 25.5%;
  bottom: 0;
  margin-bottom: -9rpx;
}

.coupon-window .couponWinList .item::before {
  content: '';
  position: absolute;
  width: 18rpx;
  height: 18rpx;
  border-radius: 50%;
  left: 25.5%;
  top: 0;
  margin-top: -9rpx;
}

.coupon-window .couponWinList .item .money {
  width: 130rpx;
  text-align: center;
  font-size: 26rpx;
  font-weight: bold;
}

.coupon-window .couponWinList .item .min_money {
  color: #ccc;
  font-size: 18rpx;
  text-align: center;
}

.coupon-window .couponWinList .item .money .num {
  font-size: 40rpx;
}

.coupon-window .couponWinList .item .text {
  width: 349rpx;
  font-size: 22rpx;
  color: #ccc;
  padding: 0 29rpx;
  box-sizing: border-box;
}

.coupon-window .couponWinList .item .text .image {
  width: 32rpx;
  height: 32rpx;
  display: inline-block;
  vertical-align: bottom;
  margin-right: 10rpx;
}

.coupon-window .couponWinList .item .text .name {
  font-size: 26rpx;
  color: var(--view-priceColor);
  font-weight: bold;
  margin-bottom: 9rpx;
  width: 250rpx;
}
.coupon-window .lid {
  width: 582rpx;
  height: 224rpx;
  position: fixed;
  z-index: 22222;
  left: 50%;
  top: 0%;
  margin: 424rpx 0 0 -296rpx;
  background: linear-gradient(90deg, #ffca52 0%, #fe960f 100%);
}

.coupon-window .lid:after {
  width: 920rpx;
  height: 350rpx;
  position: absolute;
  top: -100%;
  left: 50%;
  z-index: 22222;
  margin-left: -460rpx;
  content: '';
  border-radius: 0 0 50% 50%;
}

.coupon-window .lid .bnt {
  font-size: 29rpx;
  width: 400rpx;
  height: 80rpx;
  border-radius: 40rpx;
  background: linear-gradient(90deg, #ffca52 0%, #fe960f 100%);
  text-align: center;
  line-height: 80rpx;
  font-weight: bold;
  margin: 130rpx auto 0 auto;
  color: #333;
}

.coupon-window .lid .iconfont {
  background: linear-gradient(90deg, #ffca52 0%, #fe960f 100%);
  color: #333;
  font-size: 60rpx;
  text-align: center;
  padding: 30rpx;
}
</style>
